//
//  MLMenuButton.m
//  QuickCure
//
//  Created by 马文星 on 16/4/29.
//  Copyright © 2016年 Demos. All rights reserved.
//

#import "MLMenuButton.h"

#define kButtonW 80



CGFloat btnWH = 80;

CGFloat marginY = 5;

@implementation MLMenuButton


-(void)drawRect:(CGRect)rect{
//    [super drawRect:rect];
    
    [self setupUI];
}

-(void)setupUI{


    
    self.imageView.image = [UIImage imageNamed:@"content_img_02"];
    
    self.titleLabel.text = @"欢迎回来";

    
}


-(void)layoutSubviews{

    [super layoutSubviews];

//    CGFloat H = CGRectGetHeight(self.frame);
    CGFloat W = CGRectGetWidth(self.frame);

    CGFloat btnW = 55*kProportion6P;
    
    self.imageView.x = (W-btnW)*0.5;
    self.imageView.y = 0;
    self.imageView.size = CGSizeMake(btnW, btnW);
    
    [self.titleLabel sizeToFit];
    self.titleLabel.x = 0;
    self.titleLabel.y =  btnW;
    self.titleLabel.size =CGSizeMake(55, 40);
    self.titleLabel.font = [UIFont systemFontOfSize:14];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
  
}




@end
